package com.bang.itstack.day12;

/**
 * @ClassName: ProxyImage
 * @Desc: TODO
 * @author: <Bang>
 * @Date: 2021/10/22 16:55
 * @Version: 1.0
 * @Modified By:
 */
public class ProxyImage implements Image {

    private Image image;

    private String fileName;

    public ProxyImage(String fileName) {
        this.fileName = fileName;
    }

    @Override
    public void display() {
        if (null == image) {
            image = new RealImage(fileName);
        }
        image.display();
    }
}
